package com.txunda.zhuohired.aty.login;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.txunda.zhuohired.R;
import com.txunda.zhuohired.base.BaseAty;

/**
 * 创建人： Txd_Cjh
 * 创建时间： 2018/3/10 13:49
 * 功能描述：企业介绍
 * 联系方式：jiahuanchen@126.com
 */

public class CompanyApproveIntroduceAty extends BaseAty {
    /**
     * 标题
     */
    @ViewInject(R.id.tv_layout_white_center)
    private TextView tv_layout_white_center;
    /**
     * 保存
     */
    @ViewInject(R.id.tv_layout_white_right)
    private TextView tv_layout_white_right;
    /**
     * 企业介绍
     */
    @ViewInject(R.id.et_company_approve_introduce)
    private EditText et_company_approve_introduce;

    private String company_introduce = "";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        showStatusBar(R.id.layout_white_head);
        tv_layout_white_center.setText("企业介绍");
        tv_layout_white_right.setVisibility(View.VISIBLE);
        tv_layout_white_right.setText("保存");
    }

    @Override
    @OnClick({R.id.tv_layout_white_right})
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.tv_layout_white_right://保存
                company_introduce = et_company_approve_introduce.getText().toString().trim();
                if(TextUtils.isEmpty(company_introduce)){
                    showErrorTip("请输入企业介绍");
                    return;
                }
                Intent intent = new Intent();
                intent.putExtra("company_introduce",company_introduce);
                setResult(RESULT_OK,intent);
                closeKeyboard(this,tv_layout_white_right);
                finish();
                break;
        }
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.aty_company_approve_introduce;
    }

    @Override
    protected void initialized() {

    }

    @Override
    protected void requestData() {

    }
}
